I have 2 cases. If I did
Code:
awk '{if(NR==27)$2="NaN";print NR"\t"$2}' input > output
I can get result. It means for NR=27, the second column in output file will be NaN
But I modified the command
Code:
for nn in 27
do
awk '{if(NR=="'"${nn}"'")$2="NaN";print NR"\t"$2}' input > output
done
I didn't get the result the same as the first way. It means there is no change for the second column of NR=27.
Are there some tricks to deal with it?
Any kind help is greatly thanked.